import { BasicColumn } from '/@/components/Table/src/types/table';
import { FormProps } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';

const { t } = useI18n();

/**
 * 模块名:废止区表格数据
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/12/30 11:05:15
 */
export function getAbolishColumns(): BasicColumn[] {
  return [
    {
      title: t('routes.table.cancellationList.documentCode'),
      dataIndex: 'thitObjId',
      fixed: 'left',
      align: 'left',
      width: 300,
    },
    {
      title: t('routes.table.cancellationList.documentName'),
      dataIndex: 'name',
      width: 200,
      align: 'left',
    },
    {
      title: t('routes.table.cancellationList.documentType'),
      dataIndex: 'typeName',
      width: 200,
      align: 'left',
    },
    {
      title: t('routes.table.cancellationList.version'),
      dataIndex: 'version',
      width: 200,
      align: 'left',
    },
    {
      title: t('routes.table.cancellationList.identifier'),
      dataIndex: 'status',
      width: 200,
      align: 'left',
      slots: { customRender: 'status' },
    },
    {
      title: t('routes.table.cancellationList.customAttributeSet'),
      dataIndex: 'allCustomProp',
      width: 200,
      align: 'left',
    },
  ];
}

export function getAbolishConfig(): Partial<FormProps> {
  return {
    labelWidth: 100,
    colon: true, // 是否显示冒号
    schemas: [
      {
        field: `name`,
        label: t('routes.table.cancellationList.documentName'),
        component: 'Input',
        colProps: {
          xl: 12,
          xxl: 8,
        },
        componentProps: {
          placeholder: t('routes.table.cancellationList.documentNamePlaceholder'),
        },
      },
      {
        field: `ThitObjId`,
        label: t('routes.table.cancellationList.documentCode'),
        component: 'Input',
        colProps: {
          xl: 12,
          xxl: 8,
        },
        componentProps: {
          placeholder: t('routes.table.cancellationList.documentCodePlaceholder'),
        },
      },
    ],
  };
}
